/**
 * 
 */
package com.cp16.tss.model;

import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * @author GiangHN
 * @version 1.0
 * @since 01/01/2014
 * 
 */
@Entity
@Table(name = "CUSTOMER")
public class Customer {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ID", nullable = false)
	private int ID;
	@Column(name = "CUSTOMER_ID", length = 4, nullable = false)
	private String customerID;
	@Column(name = "CUSTOMER_NAME")
	private String customerName;
	@ManyToMany(cascade = CascadeType.ALL)
	@JoinTable(name = "CUS_SER", joinColumns = @JoinColumn(name = "CUS_ID"), inverseJoinColumns = @JoinColumn(name = "SER_ID"))
	private Collection<Service> lstSercives = new ArrayList<Service>();
	@Column(name = "ADDRESS")
	@Embedded
	private Address address;

	/**
	 * @return the iD
	 */
	public int getID() {
		return ID;
	}

	/**
	 * @param iD
	 *            the iD to set
	 */
	public void setID(int iD) {
		ID = iD;
	}

	
	/**
	 * @return the customerID
	 */
	public String getCustomerID() {
		return customerID;
	}

	/**
	 * @param customerID
	 *            the customerID to set
	 */
	public void setCustomerID(String customerID) {
		this.customerID = customerID;
	}

	/**
	 * @return the customerName
	 */
	public String getCustomerName() {
		return customerName;
	}

	/**
	 * @param customerName
	 *            the customerName to set
	 */
	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	/**
	 * @return the lstSercives
	 */
	public Collection<Service> getLstSercives() {
		return lstSercives;
	}

	/**
	 * @param lstSercives
	 *            the lstSercives to set
	 */
	public void setLstSercives(Collection<Service> lstSercives) {
		this.lstSercives = lstSercives;
	}

	/**
	 * @return the address
	 */
	public Address getAddress() {
		return address;
	}

	/**
	 * @param address
	 *            the address to set
	 */
	public void setAddress(Address address) {
		this.address = address;
	}

}
